Link to this headingMontgomery Curves
https://neuromancer.sk/std/other/
Curve Formula:
by^2 = x^3 + ax^2 + x
Link to this headingCurve25519
Use Curve25519 (X25519, Ed25519)
Any 128 bits contain are valid points on the curve this prevents any Invalid Curve Point Attacks except for the 0 point.
Curve Formula:
y^2 = x^3 + 486662 * x^2 + x
Curve 25519 Hardware Acceleration
Link to this headingZero Point Public Key Attack
https://vnhacker.blogspot.com/2015/09/why-not-validating-curve25519-public.html
Link to this headingChoosing a Private Key
#Generate Random Number
=
#Set the last 3 bits to Zero this makes the random divisible by 8.
#Where 8 is the cofactor of the curve.
#This makes sure that every point multiplied by this is in the correct subgroup
&= 0xF8
#Clear the Highest bit to 0
&= 0x7F
#Set the second highest bit to 1
|= 0x40
return
Link to this headingPoint is not in the Correct Subgroup
Send a point that is in a small subgroup. The point at x=1 has an order of 4, which makes it perfect to test.
Getting the correct point in the subgroup:
=
=
=
=
=
"""
Order Factors: 2^3 * 7237005577332262213973186563042994240857116359379907606001950938285454250989
1,4: [(1 : 9094040566125962849133224048217411091405536248825867518642941381412595940312 : 1), (1 : 48802004052532134862652268456126542835229456083994414501085850622543968879637 : 1)]
"""
Testing that the provided point is in the correct subgroup:
# Test that the point is in the correct subgroup
=
=
=
#This point is in a small subgroup of size 4
=
#subgroup_points: [(1 : 9094040566125962849133224048217411091405536248825867518642941381412595940312 : 1), (1 : 48802004052532134862652268456126542835229456083994414501085850622543968879637 : 1)]
#Test that the G.order() * point is the infinity point
# This will work on any multable of G since G*random*order can be simplified to INF*random
= *
#g_ord * subgroup_points: (1 : 9094040566125962849133224048217411091405536248825867518642941381412595940312 : 1)
= *
#g_ord * generator_point: (0 : 1 : 0)
Link to this headingCurve383187
Link to this headingM Curves
- M-221 (Curve2213)
- M-383
- M-511 (Curve511187)
Link to this headingBaby Jubjub
Used in [Zero Knowledge Proofs](/Crypto/Zero Knowledge Proofs)
Curve Formula:
= 21888242871839275222246405745257275088548364400416034343698204186575808495617
= 736030358979909402780800718157159386076813972158567259200215660948447373041
= 168698
= 8 *
^2 = ^3 + * ^2 +
Ed Formula:
= 9706598848417545097372247223557719406784115219466060233080913168975159366771
^2 + ^2 = 1 + * ^2 * ^2